
import React from 'react';
import { Icon, Divider, Button, Upload,Tabs,Table,Input,message,Radio,Modal,Tag,Pagination,Spin,Select} from 'antd'
import Son from '../../widgets/Frame/index.jsx'
import {BaseUrl} from '../common/common';
import { Link } from 'react-router-dom'
const { Search } = Input;
const { Column } = Table;
const Option = Select.Option;
const TabPane = Tabs.TabPane;
let randomColor =[];
class AddBatch extends React.Component{
    constructor(props){
        super(props);
        this.state = {
           cate:"acidbacteria",
           is_canvas_:"none",
           is_canvas:"block",
            seach_name:'',
            title:'检测记录',
           URL_SON:"/api/v1/log_detail",
           TYPE:"验证",
           apitype:""
        }
        this.zoom =1
    }
    getValue(str) {
        if(str == undefined) return
        str = str.substr(1)
        var arr = str.split("&"),
            obj = {},
            newArr = []
        arr.map(function(value,index,arr){
            newArr = value.split("=")
            if(newArr[0] != undefined) {
                obj[newArr[0]] = newArr[1]
            }
        })
        return obj
    }
    componentDidMount =()=>{
        let searchinfo =  this.getValue(this.props.location.search);
        var  strs=decodeURI(window.location.href).split("/");
        this.state.apitype = strs.splice(strs.length-2,1)
        this.setState({
            apitype:this.state.apitype[0]
        })


    }

    render(){

    return(
        <div>
            <Son
                title={this.state.title}
                modelversion = {this.props.match.params.modelversion}
                detecttype={this.props.match.params.detecttype}
                imgnum={this.props.match.params.imgnum}
                logid={this.props.match.params.logid}
                taskid={this.props.match.params.taskid}
                URL_SON = {this.state.URL_SON}
                TYPE={this.state.TYPE}
                apitype={this.state.apitype}
            />
        </div>
    )
  }
}

export default AddBatch;
